local null_ls = require "null-ls"

return {
  method = null_ls.methods.FORMATTING,
  filetypes = { "nim" },
  generator = null_ls.generator {
    command = "nph",
    args = { "-" },
    to_stdin = true,
    ignore_stderr = true,
    check_exit_code = function()
      return true
    end,
    on_output = function(params, done)
      if params.output then
        done { { text = params.output } }
      else
        done()
      end
    end,
  },
}
